package site;

import java.io.IOException;

import javax.ejb.EJB;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class ReunionServlet
 */
public class ReunionServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
	@EJB
	ReunionManager rm ;
	
    /**
     * @see HttpServlet#HttpServlet()
     */
    public ReunionServlet() {
        super();
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String objet = request.getParameter("Objet");
		int jj = Integer.parseInt(request.getParameter("jour"));
		int mm =Integer.parseInt(request.getParameter("mois"));
		int aaaa = Integer.parseInt(request.getParameter("an"));
		String commentaire = request.getParameter("commentaire");
		String lieu = request.getParameter("Lieu");
		rm.ajouterReunion (objet,jj,mm,aaaa,commentaire,lieu);
		request.getRequestDispatcher("reunion2.html").forward(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet (request,response);
	}

}
